#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <cmath>
class Sqrt
{
public:
    double operator()(int i){
        return sqrt(i);
    }
};
            
int main()
{
    std::vector<int> vi;
    for(int i = 1; i <= 100; ++i){
        vi.push_back(i * i);
    }
    std::copy(vi.begin(), vi.end(), std::ostream_iterator<int>(std::cout, " "));
    std::vector<double> vd;
    std::transform(vi.begin(), vi.end(), vd.begin(), Sqrt());
    std::copy(vd.begin(), vd.end(), std::ostream_iterator<double>(std::cout, " "));
}
